package me.buick.util.snmp.core.pojo;

import java.io.Serializable;
/**
 * Version 1.0
 * 
 * @author buick
 *
 */
public class ProcessInfoPojo implements Serializable{

	private static final long serialVersionUID = 6891734744586777242L;
	
	private int 	pid;
	private String  procName;
	private int 	procPerfCPUTimeInCentiSecs;
	private int 	procPerfMemKBytes;
	private String  procParameters;
	private String	procPath;
	private int		procType;
	private int		procRunningStatus;
	private double  cpuPerc;
	private int 	cpuCores;

	public ProcessInfoPojo(int pid, String procName, String procParameters, String procPath, int procPerfCPUTimeInCentiSecs, int procPerfMemKBytes, int procRunningStatus, int procType, int cpuCores){
		this.pid 		   = pid;
		this.procName 	   = procName;
		this.procParameters	   = procParameters;
		this.procPerfCPUTimeInCentiSecs   = procPerfCPUTimeInCentiSecs;
		this.procPerfMemKBytes = procPerfMemKBytes;
		this.procType = procType;
		this.procPath = procPath;
		this.procRunningStatus = procRunningStatus;
		this.cpuCores = cpuCores;
	}

	public int getPid() {
		return pid;
	}

	public void setPid(int pid) {
		this.pid = pid;
	}

	public String getProcName() {
		if(procName != null)
			return procName.toLowerCase();
		else
			return "";
	}

	public void setProcName(String procName) {
		this.procName = procName;
	}

	public int getProcPerfCPUTimeInCentiSecs() {
		return procPerfCPUTimeInCentiSecs;
	}

	public void setProcPerfCPUTimeInCentiSecs(int procPerfCPUTimeInCentiSecs) {
		this.procPerfCPUTimeInCentiSecs = procPerfCPUTimeInCentiSecs;
	}

	public int getProcPerfMemKBytes() {
		return procPerfMemKBytes;
	}

	public void setProcPerfMemKBytes(int procPerfMemKBytes) {
		this.procPerfMemKBytes = procPerfMemKBytes;
	}

	public String getProcParameters() {
		if(procParameters != null)
			return procParameters.toLowerCase();
		else
			return "";
	}

	public void setProcParameters(String procParameters) {
		this.procParameters = procParameters;
	}

	public String getProcPath() {
		if(procPath != null)
			return procPath.toLowerCase();
		else
			return "";
	}

	public void setProcPath(String procPath) {
		this.procPath = procPath;
	}

	public int getProcType() {
		return procType;
	}

	public void setProcType(int procType) {
		this.procType = procType;
	}

	public int getProcRunningStatus() {
		return procRunningStatus;
	}

	public void setProcRunningStatus(int procRunningStatus) {
		this.procRunningStatus = procRunningStatus;
	}
	
	public double getCPUPerc(){
		return this.cpuPerc;
	}
	
	public void setCPUPerc(double cpuPerc){
		this.cpuPerc = cpuPerc;
	}
	
	public int getCPUCores() {
		return cpuCores;
	}

	public void setCPUCores(int cpuCores) {
		this.cpuCores = cpuCores;
	}
	
	public String getProcTypeString() {
		switch (this.procType){
			case 1: return "unknown";
			case 2: return "operatingSystem";
			case 3: return "deviceDriver";
			case 4: return "application";
		   default: return "unknown";
		}
	}
	
	public String getProcRunningStatusString() {
		switch (this.procRunningStatus){
			case 1: return "running";
			case 2: return "runnable";
			case 3: return "notRunnable";
			case 4: return "invalid";
		   default: return "unknown";
		}
	}
	
}
